#include "HermiteInterp.h"

int main(int argc, char* argv[]){
  HermiteInterp<double,2> HI;
  InterpConditions<double,2> IC;
  vector<vector<double> > doubleTab;
  double tmp1[4] = {1.1,2,3,4.5};
  vector<double> doubleVec0(tmp1,tmp1+4);
  vector<double> doubleVec1(4,1.2);
  doubleVec1[1] = 2;
  doubleVec1[2] = 3.6;
  doubleVec1[3] = 5;
  vector<double> doubleVec2(4,-0.3);
  doubleVec2[0] = 2.3;
  doubleTab.push_back(doubleVec0);
  doubleTab.push_back(doubleVec1);
  doubleTab.push_back(doubleVec2);
  vector<vector<bool> > boolTab;
  vector<bool> boolVec0(4,1);
  vector<bool> boolVec1(4,1);
  bool tmp2[4] = {1,0,0,1};
  vector<bool> boolVec2(tmp2,tmp2+4);
  boolTab.push_back(boolVec0);
  boolTab.push_back(boolVec1);
  boolTab.push_back(boolVec2);
  IC.setTable(doubleTab,boolTab);
  HermiteInterp<double,2> HI1(IC);
  HermiteInterp<double,2> HI2("Inputfile/testfile/test1");
  cout << "Test for input :" << endl;
  cout << "Input of HI1: " << endl;
  cout << HI1.getPreConditions();
  cout << "Input of HI2: " << endl;
  cout << HI2.getPreConditions();
  cout << "Test for result :" << endl;
  cout << "result of HI1: " << HI1.getInterPoly() << endl;
  cout << "result of HI2: " << HI2.getInterPoly() << endl;
  cout << "Test for correctness :" << endl;
  HermiteInterp<double,2> HI3("Inputfile/testfile/test2");
  cout << "Input :" << endl;
  cout << HI3.getPreConditions();
  double d3[5] = {1,-2,2,-1,1};
  vector<double> vec3(d3,d3+5);
  Polynomial<double> Poly3(vec3);
  cout << "expect :" << Poly3 << endl;
  cout << "result :" << HI3.getInterPoly() << endl;
  
  
}
